import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  FlatList,
  ActivityIndicator
} from 'react-native';

const util = require("./common/util.js");
export default class flatList extends Component {
  constructor(props) {
    super(props);
    this.state = {
      animating: true
    };
    this.setToggleTimeout = this.setToggleTimeout.bind(this);
  }
  componentDidMount() {
    this.setToggleTimeout();
  }
  setToggleTimeout(){
    setTimeout(()=>{
      console.log("good");
      this.setState({animating: !this.state.animating});
      this.setToggleTimeout();
    }, 2000);
  }
  render() {
    return (
       <ActivityIndicator 
        animating = {this.state.animating}
        style={{paddingTop: 80}}
        size="small"
        hidesWhenStopped={true}
       />
    );
  }
}

const styles = StyleSheet.create({

});

module.exports = flatList;
